//
//  NSString+IMTExtension.h
//  MusicLamp
//
//  Created by lorin on 15/3/17.
//  Copyright (c) 2015年 imt_ios_group. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface NSString (IMTExtension)

- (BOOL)isBlank;

-(BOOL)isMobliePhoneNumber;//验证是否是合法的手机号
-(BOOL)isValidSMSVerifyCode;//是否是合法的短信验证码，纯数字3-6位
-(BOOL)isEmail;//是否是Email


#pragma mark 转拼音
//-(NSString *)getPinYin;
//-(NSString *)getPinYinFirstChar;

-(BOOL)isURLPath;
- (NSString *)URLEncodedString;

-(NSDictionary *)getURLParams;

/**
 *  返回密码组合处理过得MD5值
 *
 *  @return MD5
 */
-(NSString *)adjustPasswordMD5Hash;

/**
 * Calculate the md5 hash of this string using CC_MD5.
 *
 * @return md5 hash of this string
 */
@property (nonatomic, readonly) NSString* md5Hash;

/**
 * Calculate the SHA1 hash of this string using CommonCrypto CC_SHA1.
 *
 * @return NSString with SHA1 hash of this string
 */
@property (nonatomic, readonly) NSString* sha1Hash;

@property (nonatomic, readonly) NSString* base64String;


-(NSString *)encryptUseDESWithKey:(NSString *)key;
-(NSString *)decryptUseDESWithKey:(NSString *)key;

// 字符串添加颜色
@property(nonatomic,strong)UIColor* tintColor;

#pragma mark - adjust qiniu image size

- (NSURL *)adjust2SmallImageUrl;
- (NSURL *)adjust2MiddleImageUrl;
- (NSURL *)adjust2LargeImageUrl;

- (NSString *)adjust2SmallImageUrlString;
- (NSString *)adjust2MiddleImageUrlString;
- (NSString *)adjust2LargeImageUrlString;


#pragma mark - CreditCard format
- (NSString *)formatCreditCardNumber;
- (NSString *)clearCreditCardNumberFromat;



#pragma mark - verify
/**
 *  验证email ok 返回 nil，错误返回错误消息
 *
 *  @return 验证的结果信息 ok 返回 nil，错误返回错误消息
 */
- (NSString *)verifyEmail;
- (NSString *)verifyPassword;
- (NSString *)verifyAgainpasswordWithMiniLenght;
- (NSString *)verifyCurrentpassword;
- (NSString *)verifyNewpassword;
- (NSString *)verifyCurrentPasswordWith:(NSString *)newPassword;
- (NSString *)verifyConfirmpasswordWithMiniLenght;
- (NSString *)verifyPasswordWithMiniLenght:(BOOL)checkMiniLenght;
- (NSString *)verifyConfirmPasswordWith:(NSString *)password;
- (NSString *)verifySearchKeyword;
- (NSString *)verifyContactName;
- (NSString *)verifyStreet;
- (NSString *)verifyCity;
- (NSString *)verifyState;
- (NSString *)verifyPostalCode;
- (NSString *)verifyPhoneNumber;
- (NSString *)verifyFirstName;
- (NSString *)verifyLastName;
- (NSString *)verifyFeedback;
- (NSString *)verifyStringWithMaxLenght:(NSInteger)maxLenght;
- (NSString *)verifyStringWithoutCheckMaxLenght:(NSInteger)maxLenght; //直接返回提示信息



+ (NSString *)makeINT32Random;

@end
